from datetime import date

now = date.today()
# 按默认格式打印
print(now)
# 按指定格式打印
print(now.strftime("%m-%d-%y. %d %b %Y is a %A on the %d day of %B."))

# 创建指定时间
birthday = date(2024, 10, 1)
# 计算日期（当前时间减去指定时间）
age = now - birthday
# 打印天数差
print(age.days)

